package com.adtech.farmProducts.activities.fragment;

import android.view.View;

import com.adtech.farmProducts.App;
import com.adtech.farmProducts.R;
import com.adtech.farmProducts.activities.activity.CSearchActivity;
import com.adtech.farmProducts.activities.activity.InsertActivity;
import com.adtech.farmProducts.activities.activity.UpdateTagActivity;
import com.adtech.farmProducts.activities.activity.VerifyActivity;
import com.adtech.farmProducts.activities.activity.procurement.ProcurementActivity;
import com.adtech.farmProducts.base.BaseFragment;
import com.gyf.barlibrary.ImmersionBar;

import butterknife.OnClick;

public class IndexFragment extends BaseFragment {

    @Override
    protected int getLayoutSourceId() {
        return R.layout.fragment_index;
    }

    public static IndexFragment newInstance() {
        IndexFragment mapFragment = new IndexFragment();
        return mapFragment;
    }


    @OnClick({R.id.btn_insert, R.id.btn_verify, R.id.tv_update_tag, R.id.tv_jgcy, R.id.tv_jzcg, R.id.tv_smsj, R.id.tv_smcy})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_insert:
                InsertActivity.show(mContext);
                break;
            case R.id.btn_verify:
                VerifyActivity.show(mContext,"");
                break;
            case R.id.tv_update_tag:
                UpdateTagActivity.show(mContext,"");
                break;
            case R.id.tv_jgcy:
                App.getInstance().showMessage("暂未开放！");
                break;
            case R.id.tv_jzcg:
                ProcurementActivity.show(mContext,0);
                break;
            case R.id.tv_smsj:
                ProcurementActivity.show(mContext,1);
                break;
            case R.id.tv_smcy:
                CSearchActivity.show(mContext,1);
                break;
        }
    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this)
                .statusBarColor(R.color.trans).init();
    }

    @Override
    protected void initData() {
        super.initData();
    }
}
